//
//  BVMineCell2.m
//  XiangYu
//
//  Created by YYKJ on 2017/6/7.
//  Copyright © 2017年 YYKJ. All rights reserved.
//

#import "BVMineCell2.h"
#import "ZZProgressView.h"

@implementation BVMineCell2

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        [self layoutUI];
    }
    
    return self;
}

-(void)layoutUI{
    
    //标题图标
    self.img = [[UIImageView alloc]init];
    [self.contentView addSubview:self.img];
    [self.img.layer setMasksToBounds:YES];
    [self.img.layer setCornerRadius:3.0];
    self.img.sd_layout.
    topSpaceToView(self.contentView,15)
    .bottomSpaceToView(self.contentView,15)
    .leftSpaceToView(self.contentView,10)
    .widthEqualToHeight();
    
    //标题label
    self.titleLb = [[UILabel alloc]init];
    [self.contentView addSubview:self.titleLb];
    [self.titleLb setTextColor:[UIColor BVTextDarkGrayColor]];
    [self.titleLb setTextAlignment:NSTextAlignmentLeft];
    [self.titleLb setFont:[UIFont systemFontOfSize:14]];
    self.titleLb.sd_layout
    .topSpaceToView(self.contentView,5)
    .leftSpaceToView(_img,10)
    .bottomSpaceToView(self.contentView,5)
    .widthIs(80);
    
    self.percentageLb = [[UILabel alloc]init];
    [self.contentView addSubview:self.percentageLb];
    [self.percentageLb setTextColor:[UIColor BVTextDarkGrayColor]];
    [self.percentageLb setTextAlignment:NSTextAlignmentRight];
    [self.percentageLb setFont:[UIFont systemFontOfSize:14]];
    [self.percentageLb setText:@"20%"];
    self.percentageLb.sd_layout
    .topSpaceToView(self.contentView,5)
    .rightSpaceToView(self.contentView, 10)
    .bottomSpaceToView(self.contentView,5)
    .widthIs(80);
    
    UIProgressView *progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
    [self.contentView addSubview:progressView];
    [progressView setTrackTintColor:[UIColor blueColor]];
    [progressView setTintColor:[UIColor BVBaseOrangeColor]];
    [progressView setProgress:0.8 animated:YES];
    progressView.sd_layout
    .topSpaceToView(self.titleLb, 0)
    .leftEqualToView(self.titleLb)
    .rightSpaceToView(self.contentView, 20)
    .heightIs(1);
    
}


- (void)awakeFromNib {
    [super awakeFromNib];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
